#import "JuggleNebulaController.h"
        
#import "JuggleNebulaModel.h"
#import "JuggleNebulaCell.h"
#import "Masonry.h"

@interface JuggleNebulaController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *xylophoneJourneyJoyousTableView;
@property (nonatomic, strong) NSMutableArray *blossomKnotInfiniteArr;

@end

@implementation JuggleNebulaController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self yarnConfigsview];
	[self noodlegetData];
}


//: 获取数据模型
- (void)noodlegetData {
	
}

- (void)yarnConfigsview {
    self.xylophoneJourneyJoyousTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
    self.xylophoneJourneyJoyousTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
    self.xylophoneJourneyJoyousTableView.estimatedRowHeight = 0;
    self.xylophoneJourneyJoyousTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.xylophoneJourneyJoyousTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
    self.xylophoneJourneyJoyousTableView.delegate = self;
    self.xylophoneJourneyJoyousTableView.dataSource = self;
	self.xylophoneJourneyJoyousTableView.rowHeight = 96;
    self.xylophoneJourneyJoyousTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
    self.xylophoneJourneyJoyousTableView.showsVerticalScrollIndicator = NO;
    self.xylophoneJourneyJoyousTableView.showsHorizontalScrollIndicator = NO;
    self.xylophoneJourneyJoyousTableView.backgroundColor = UIColor.clearColor;
    [self.xylophoneJourneyJoyousTableView registerClass:[JuggleNebulaCell class] forCellReuseIdentifier:NSStringFromClass([JuggleNebulaCell class])];
    [self.view addSubview:self.xylophoneJourneyJoyousTableView];
    [self.xylophoneJourneyJoyousTableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.equalTo(self.view);
        make.top.equalTo(self.view);
        make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
    }];
}

//: 懒加载数据模型数组
- (NSMutableArray *)blossomKnotInfiniteArr {
	if (!_blossomKnotInfiniteArr) {
		_blossomKnotInfiniteArr = [NSMutableArray array];
	}
	return _blossomKnotInfiniteArr;
}

#pragma mark - UITableView DataSource 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.blossomKnotInfiniteArr.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    JuggleNebulaCell *unwind = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([JuggleNebulaCell class])];
    if (unwind == nil) {
        unwind = [[JuggleNebulaCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([JuggleNebulaCell class])];
    }
    unwind.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return unwind;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
